]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
viewSelector: don't crossfade between pages
authorCosimo Cecchi <cosimoc@gnome.org>
Thu, 24 Jan 2013 06:35:19 +0000 (01:35 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Sat, 16 Feb 2013 04:47:12 +0000 (23:47 -0500)
Instead, wait until the first animation is completed before switching to
the second page.

https://bugzilla.gnome.org/show_bug.cgi?id=693924

js/ui/viewSelector.js

index 47ffe6004653d42b3e3499226bf13c44f1415a26..b40da6fd9a70d388a3c674f22c46a2f1c43f227b 100644 (file)
@@ -12,6 +12,7 @@ const St = imports.gi.St;
 
 const AppDisplay = imports.ui.appDisplay;
 const Main = imports.ui.main;
+const OverviewControls = imports.ui.overviewControls;
 const Params = imports.misc.params;
 const RemoteSearch = imports.ui.remoteSearch;
 const Search = imports.ui.search;
@@ -203,32 +204,36 @@ const ViewSelector = new Lang.Class({
         return page;
     },
 
+    _fadePageIn: function() {
+        this._activePage.show();
+        Tweener.addTween(this._activePage,
+            { opacity: 255,
+              time: OverviewControls.SIDE_CONTROLS_ANIMATION_TIME / 2,
+              transition: 'easeOutQuad'
+            });
+    },
+
     _showPage: function(page) {
         if (page == this._activePage)
             return;
 
         let oldPage = this._activePage;
-        if (oldPage) {
+        this._activePage = page;
+        this.emit('page-changed');
+
+        if (oldPage)
             Tweener.addTween(oldPage,
                              { opacity: 0,
-                               time: 0.1,
+                               time: OverviewControls.SIDE_CONTROLS_ANIMATION_TIME / 2,
                                transition: 'easeOutQuad',
                                onComplete: Lang.bind(this,
                                    function() {
                                        oldPage.hide();
+                                       this._fadePageIn();
                                    })
                              });
-        }
-
-        this._activePage = page;
-        this._activePage.show();
-        this.emit('page-changed');
-
-        Tweener.addTween(this._activePage,
-                         { opacity: 255,
-                           time: 0.1,
-                           transition: 'easeOutQuad'
-                         });
+        else
+            this._fadePageIn();
     },
 
     _a11yFocusPage: function(page) {